	.text
.equ NOINT,0xc0 

.global EnterCritical
EnterCritical:  
	mrs	r1, cpsr
	str	r1, [r0]
	orr	r1, r1, #NOINT
	msr	cpsr_cxsf, r1		
	bx lr

.global ExitCritical
ExitCritical:
	ldr	r1, [r0]
	msr	cpsr_cxsf, r1	
	bx lr	

.global SET_IF
SET_IF:
    //This function works only if the processor is in previliged mode.
   mrs r0,cpsr
   mov r1,r0
   orr r1,r1,#NOINT
   msr cpsr_cxsf,r1
   bx lr

.global WR_IF
WR_IF:
    //This function works only if the processor is in previliged mode.
   msr cpsr_cxsf,r0
   bx lr


//void CLR_IF(void);
.global CLR_IF
CLR_IF:
    //This function works only if the processor is in previliged mode.
   mrs r0,cpsr
   bic r0,r0,#NOINT
   msr cpsr_cxsf,r0
   bx lr
   
.global outportw
outportw:
	strh	r0, [r1]
	bx lr

.global inportw
inportw:
	ldrh	r0, [r0]
	bx lr






